/*********************************************************************************
  *FileName:  nusc16xx_exit.h
  *Version:   V1.0
  *Date:      2023-09-21
 **********************************************************************************/

#ifndef __nsuc16xx_exit_H__
#define __nsuc16xx_exit_H__

/***************************************Includes***********************************/
#include "nsuc16x0.h"
#include "nsuc16xx_gpio.h"
/***************************************Macros***********************************/
#define EXTI_Source0      ((uint8_t)0x00)
#define EXTI_Source1      ((uint8_t)0x01)
#define EXTI_Source2      ((uint8_t)0x02)
#define EXTI_Source3      ((uint8_t)0x03)
#define EXTI_Source4      ((uint8_t)0x04)
#define EXTI_Source5      ((uint8_t)0x05)
#define EXTI_Source6      ((uint8_t)0x06)
#define EXTI_Source7      ((uint8_t)0x07)
#define EXTI_Source8      ((uint8_t)0x08)
#define EXTI_Source9      ((uint8_t)0x09)
#define EXTI_Source10     ((uint8_t)0x0A)


#define EXTI_LineNone    ((uint32_t)0x00000)  /*!< No External interrupt selected */
#define EXTI_Line0       ((uint32_t)0x00001)  /*!< External interrupt line 0 */
#define EXTI_Line1       ((uint32_t)0x00002)  /*!< External interrupt line 1 */
#define EXTI_Line2       ((uint32_t)0x00004)  /*!< External interrupt line 2 */
#define EXTI_Line3       ((uint32_t)0x00008)  /*!< External interrupt line 3 */
#define EXTI_Line4       ((uint32_t)0x00010)  /*!< External interrupt line 4 */
#define EXTI_Line5       ((uint32_t)0x00020)  /*!< External interrupt line 5 */
#define EXTI_Line6       ((uint32_t)0x00040)  /*!< External interrupt line 6 */
#define EXTI_Line7       ((uint32_t)0x00080)  /*!< External interrupt line 7 */
#define EXTI_Line8       ((uint32_t)0x00100)  /*!< External interrupt line 8 */
#define EXTI_Line9       ((uint32_t)0x00200)  /*!< External interrupt line 9 */
#define EXTI_Line10      ((uint32_t)0x00400)  /*!< External interrupt line 10 */

typedef enum
{
    EXTI_Trigger_close = 0x00,
    EXTI_Trigger_Rising = 0x01,
    EXTI_Trigger_Falling = 0x02,
    EXTI_Trigger_Rising_Falling = 0x03
} EXTITrigger_TypeDef;


typedef struct
{
  uint32_t EXTI_Source; 
  EXTITrigger_TypeDef EXTI_Trigger; 
  FunctionalState EXTI_LineCmd;    
}EXTI_InitTypeDef;

/***************************************Variables***********************************/

/***************************************Functions***********************************/
void EXTI_Init(EXTI_InitTypeDef* EXTI_InitStruct);
ITStatus EXTI_GetITStatus(uint32_t EXTI_Line);
void EXTI_ClearITPendingBit(uint32_t EXTI_Line);

#endif
/* [] END OF nsuc16xx_exit.h */
